package com.rjwh.dingdong.client.mvp.model.impl;

import com.aishua.lib.task.AsResult;
import com.rjwh.dingdong.client.application.MyApplication;
import com.rjwh.dingdong.client.constant.LocalConstant;
import com.rjwh.dingdong.client.constant.NetConstant;
import com.rjwh.dingdong.client.mvp.BaseModel;
import com.rjwh.dingdong.client.mvp.BasePresenter;
import com.rjwh.dingdong.client.mvp.model.IMorePointsDetialModel;
import com.rjwh.dingdong.client.network.HttpWebService;
import com.rjwh.dingdong.client.network.HttpWebServiceCallBack;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Kay
 * @ClassName MorePointsDetialModel
 * @Description
 * @date 2016-9-28
 * @history 2016-9-28 author: description:
 */

public class MorePointsDetialModel extends BaseModel implements IMorePointsDetialModel, HttpWebServiceCallBack {

    public MorePointsDetialModel(BasePresenter basePresenter) {
        super(basePresenter);
    }

    /**
     * 获取积分明细
     */
    @Override
    public void doGetMyScoreRecord(int pageindex,int type, boolean isRefresh) {
        Map<String, String> params = new HashMap<>();
        params.put("pageindex", String.valueOf(pageindex));
        params.put("type", String.valueOf(type));
        HttpWebService.getDataFromServer(NetConstant.GETMYSCORERECORD, params, isRefresh, this);
    }

    @Override
    public void onServerDataAcquired(int businessType, AsResult mAsResult, boolean isRefresh) {
        if (getBasePresenter() != null) {
            getBasePresenter().onServerDataAcquired(businessType, mAsResult, isRefresh);
        }
    }
}
